package com.lxy.controller;

import com.lxy.dao.DoctorDao;
import com.lxy.entity.Doctor;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

public class DoctorController {
    public static List<Doctor> query() {
        DoctorDao doctorDao = new DoctorDao();
        return doctorDao.query();
    }

    public static ArrayList<Doctor> doctorQuery(String name) {
        DoctorDao doctorDao = new DoctorDao();
        return doctorDao.doctorQuery(name);
    }

    public static Integer updateDoctor(String name, String property, String propertyValue) throws SQLException {
        DoctorDao doctorDao = new DoctorDao();
        return doctorDao.updateDoctor(name, property, propertyValue);
    }

    public static Integer deleteDoctor(String name) {
        DoctorDao doctorDao = new DoctorDao();
        return doctorDao.DeleteDoctor(name);
    }

    public static Integer insertDoctor(Doctor doctor) {
        DoctorDao doctorDao = new DoctorDao();
        return doctorDao.insertDoctor(doctor);
    }
}